  <%if (not @project.use_permission or @project.use_permission.nil?) or (@project.use_permission and (@project.wb_categories.select{|c| @cur_user.has_permission?("prj_" + @project.id.to_s + "_#{c.id}_wb_cat_new")}.size > 0 or @cur_user.has_permission?("prj_" + @project.id.to_s + "_unc_wb_cat_new")))%>
     <%=link_to image_tag("add_a_new_writeboard.gif".t,:border=>0),new_project_writeboard_path(params[:project_id])%>
   <%end%>
<div id=cat_sidebar> 
<h3>
 <%if (not @project.use_permission) or (@project.use_permission and @cur_user.have_power?(@project))%>
<span id="edit_display" class=float_right><%=link_to "Edit".t,"#",:onclick=>"Element.toggle('rename');Element.toggle('edit_display');Element.toggle('edit_hide');Element.toggle('new_cat')",:class=>'admin'%></span>
<%end%>
<span id="edit_hide" class=float_right style="display:none"><%=link_to "Done edit".t,"#",:onclick=>"Element.toggle('rename');Element.toggle('edit_display');Element.toggle('edit_hide');Element.toggle('new_cat')",:class=>'admin'%></span>
<%="Writeboard Categories".t%>
</h3>
<div class="activity_item">
<div id='rename' style="right:10px;border:0px red solid;height:<%=(@project.wb_categories.size + 2) * 30%>px;width:78px;background:#e5e5e5;clear: both;position:absolute"></div>
<%if params[:category_id].nil?%>
<span class=selected_label>
<%else%>
<span class=label>
<%end%>
<%=link_to "All Writeboards".t,project_writeboards_path(params[:project_id])%>(<%=@project.writeboards.size%>)
</span>
</div>

<div class='activity_item'>
<%if params[:category_id].to_s == "uncat"%>
<span class=selected_label>
<%else%>
<span class=label>
<%end%>
<%=link_to "Uncategorized".t,project_wb_in_category_path(params[:project_id],"uncat")%>(<%=@project.uncat_wb_size%>)
</span>
</div>

<div id=cat_side_show>
<%=render :partial=>'categories/sidebar_list',:locals=>{:project=>Project.find(params[:project_id]),:label=>'writeboards'}%>
</div>
</div>

<hr>
<%if @writeboard%>
<%form_for :diff,:url=> diff_project_writeboards_path(@project) do |f|%>
<%=f.hidden_field :wid,:value=>@writeboard.id%>
<table class=clean>
<%size = @writeboard.wikis.size%>
<%line_num = 1%>
<%@writeboard.wikis.each_with_index do |w,i|%>
<tr>
<td>#<%=(ver = size - line_num + 1)%></td>
  <td class="checkbox"><%=radio_button_tag('version',w.id.to_s + "_" + ver.to_s, (line_num==1 or (params[:version] && w.id == params[:version].split("_").first.to_i)), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if line_num < size %></td>
  <td class="checkbox"><%=radio_button_tag('version_from',w.id.to_s + "_" + ver.to_s, (line_num==2 or (params[:version_from] && w.id== params[:version_from].split("_").first.to_i)), :id => "cbto-#{line_num}", :onclick => "if ($('cb-#{line_num}').checked==true || $('version_from').value > #{w.id}) {$('cb-#{line_num-1}').checked=true;}") if (line_num > 1) %></td>
<td>
<%if w.id == params[:wiid].to_i%>
<span class="selected_label">
<%else%>
<span>
<%end%>
<%=link_to w.created_at.strftime("%m/%d %H:%M") + " " + "by".t + " " + w.user.name, project_writeboard_path(@writeboard.project,@writeboard) + "?wiid=" + w.id.to_s%>
</span>
</td></tr>
<%line_num += 1%>
<%end%>
</table>
<%=submit_tag "Compare version".t,:style=>"font-size:12px;font-weight:bold;width:200px;margin:0px;height:25px;padding:0px;text-align:center",:disabled=>line_num == 2%>
<%end%>
<%end%>

